<?php include_once ROOT . '/views/layouts/header.php'; ?>

    <div class="bg-white">
        <main class="my-8">
            <div class="container mx-auto px-6">
                <div class="md:flex md:items-center">
                    <div class="w-full h-64 md:w-1/2 lg:h-96">
                        <img class="h-full w-full rounded-md object-contain max-w-lg mx-auto"
                             src="data:image/jpeg;base64,<?= base64_encode($product['img']) ?>">
                    </div>
                    <div class="w-full max-w-lg mx-auto mt-5 md:ml-8 md:mt-0 md:w-1/2">
                        <h3 class="text-gray-700 uppercase text-lg"><?= $product['name'] ?></h3>

                        <div>
                            <span class="text-gray-500 mt-3"><?= $product['description'] ?></span>
                        </div>
                        <div>
                            <span class="text-gray-500 mt-3"><span
                                        class="font-bold">Жанр: </span><?= $product['shanr'] ?></span>
                        </div>
                        <div>
                            <span class="text-gray-500 mt-3"><span
                                        class="font-bold">Издатель: </span><?= $product['izdatel'] ?></span>
                        </div>
                        <div>
                    <span class="text-gray-500 mt-3">
                        <span class="font-bold">Выход в прокат: </span>
                        <?php $timestamp = strtotime($product['date']);
                        echo date('Y', $timestamp)
                        ?> г.
                    </span>
                        </div>
                        <hr class="my-3">
                        <div class="flex items-center mt-6">
                            <button class=" px-8 py-2 bg-indigo-600 text-white text-sm font-medium rounded hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500">
                                Купить - <?= $product['price'] ?>$
                            </button>
                            <div class="add-to-cart">
                                <button class=" mx-2 text-gray-600 border rounded-md p-2 hover:bg-gray-200 focus:outline-none add-to-cart"
                                        data-id="<?php echo $product['id']; ?>">
                                    <svg class="h-5 w-5" fill="none" stroke-linecap="round" stroke-linejoin="round"
                                         stroke-width="2" viewBox="0 0 24 24" stroke="currentColor">
                                        <path d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
                                    </svg>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

<?php include_once ROOT . '/views/layouts/footer.php'; ?>